import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RecommendComponent } from './recommend.component';
import { ShareModule } from 'src/app/share/share.module';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  {
    path: '',
    component: RecommendComponent,
    children: [
      { path: '', redirectTo: 'music', pathMatch: 'full' },
      { path: 'music', loadChildren: () => import('./music/music.module').then(mod => mod.MusicModule) },
      { path: 'mv', loadChildren: () => import('./mv/mv.module').then(mod => mod.MvModule) },
      { path: 'channel', loadChildren: () => import('./channel/channel.module').then(mod => mod.ChannelModule) },
      { path: 'rank', loadChildren: () => import('./rank/rank.module').then(mod => mod.RankModule) },
    ]
  },
]

@NgModule({
  declarations: [RecommendComponent],
  imports: [
    ShareModule,
    RouterModule.forChild(routes)
  ]
})
export class RecommendModule { }
